# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=dos2unix
pkgver=7.4.1
pkgrel=0
pkgdesc="Text file format converters"
url="http://waterlan.home.xs4all.nl/dos2unix.html"
arch="all"
license="BSD-2-Clause"
checkdepends="gettext-dev perl-utils"
subpackages="$pkgname-doc"
source="http://waterlan.home.xs4all.nl/dos2unix/dos2unix-$pkgver.tar.gz"

prepare() {
	default_prepare
	sed -e '/^LDFLAGS/s|=|+=|' \
		-e '/CFLAGS_OS \+=/d' \
		-e '/LDFLAGS_EXTRA \+=/d' \
		-e "/^CFLAGS/s|-O2|${CFLAGS}|" \
		-i Makefile
}

build() {
	make ENABLE_NLS= -C "$builddir"
}

check() {
	make check -C "$builddir"
}

package() {
	make prefix=/usr \
		docsubdir=$pkgname \
		ENABLE_NLS= \
		DESTDIR="$pkgdir" \
		-C "$builddir" install
}

sha512sums="81e7cff82d95b298fb218b073f54d17fa851a7507fbd54b3cd9af7c1efa6a7bd3cf59f7a84ffbaf395403bf458650763e1755944451b24f708878a9c62316dc4  dos2unix-7.4.1.tar.gz"
